package com.caregiver.watch.business.data.controller;


import com.caregiver.watch.business.data.service.DeviceDataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * This api is for watch uploading health data, the route /pb/upload can't be changed
 * content-type : application/octet-stream
 */
@Tag(name  = "DevicePBController", description = "设备服务")
@Slf4j
@RestController
@RequestMapping("/pb")
public class DevicePBController {

    @Autowired
    private DeviceDataService deviceService;

    @Operation(summary = "一般数据（大部分手表数据）上传", description = "一般数据（大部分手表数据）上传")
    @RequestMapping(value = "upload", method = RequestMethod.POST)
    private void uploadPBData(HttpServletRequest req, HttpServletResponse resp) {
        deviceService.uploadPBData(req, resp);
    }

}
